package proxy.cglibproxy;

/**
 * @program: java-base->Test
 * @description: test cglib
 * @author: G_Y
 * @create: 2019-08-21 18:05
 **/
public class Test {

    public static void main(String[] args) {
        // 获取代理实例
        User proxyInstance = MyMethodInterceptor.getProxyInstance(User.class);
        String s = proxyInstance.sayAge(29);
        System.out.println("---------------------");
        System.out.println(s);

        System.out.println("==========================");
        // 使用模拟的cglib代理类对象
        UserProxy userProxy = new UserProxy(new MyMethodInterceptor());
        String s1 = userProxy.sayAge(18);
        System.out.println(s1);

    }
}
